<template>
	<view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				option: {
					token: '',
					from: '',
					pageType: '' //哪一个页面跳转过来的
				}
			};
		},
		onLoad(option) {
			this.option = option
			this.getLoginBaseInfo()
		},
		methods: {
			//获取登录基本信息
			getLoginBaseInfo() {
				this.$store.commit('SET_token', this.option.token)
				this.$store.dispatch('get_userInfo').then(res => {
					switch (this.option.pageType) {
						case 'recharge':
							uni.redirectTo({
								url: '/pages/money/recharge?' + this.$util.businessUtil.paramURL(this.option)
							})
							break;
						case 'orderPay':
							uni.redirectTo({
								url: '/pages/cart/pay?' + this.$util.businessUtil.paramURL(this.option)
							})
							break;

						case 'withdrawal':
							uni.redirectTo({
								url: '/pages/money/withdrawal?' + this.$util.businessUtil.paramURL(this.option)
							})
							break;
						default:
							break;
					}
				})
			}
		},
	}
</script>

<style lang="scss">

</style>